<template>
  <div id="znkzfx-box">
    <div class="znkzfx-title">智能控制管理</div>
    <dv-scroll-ranking-board :config="config" />
  </div>
</template>

<script>
import { WSD} from "@/api/fjzt/fjzt1";
export default {
  name: 'znkzfx',
  data () {
    return {
      from:{},

      config: {
        data:[],
        rowNum: 3
      }
    }
  },
  mounted() {
    this.getIndex();
  },
  methods:{
    getIndex() {
      WSD().then(response => {

        console.log(response)
        let newarr=[];
        let sevm1={},sevm2={},sevm3={};

        sevm1['name']='房间人数'
        sevm1['value']=response.data.rs;
        newarr.push(sevm1);
        sevm2['name']='房间温度'
        sevm2['value']=response.data.wd;
        newarr.push(sevm2);
        sevm3['name']='房间湿度'
        sevm3['value']=response.data.sd;
        newarr.push(sevm3);

        console.log("newarr",newarr)
        this.config = {
          data: newarr,
        }

      });
    },
  }
}
</script>

<style lang="less">
#znkzfx-box {
  width: 20%;
  box-shadow: 0 0 3px blue;
  display: flex;
  flex-direction: column;
  background-color: rgba(6, 30, 93, 0.5);
  border-top: 2px solid rgba(1, 153, 209, .5);
  box-sizing: border-box;
  padding: 0px 30px;

  .znkzfx-title {
    font-weight: bold;
    height: 50px;
    display: flex;
    align-items: center;
    font-size: 20px;
  }


}
</style>
